TRANSFORM
General Format
TRANSFORM identifier-1 CHARACTERS FROM pattern-1 TO pattern-2 |
General rules
OS/VS COBOL supported the TRANSFORM statement and has been replaced by INSPECT CONVERTING statements. isCOBOL supports either statement.
The
-cv compiler option is required to compile this statement.
Examples
77 DATA-T PICTURE X(9) VALUE "ABCXYZCCC" . . . TRANSFORM DATA-T FROM "ABC" TO "CAT" |
The above OS/VS COBOL TRANSFORM statement evaluates each character, changing each A to C, each B to A, and each C to T.
After the TRANSFORM statement is executed, DATA-T contains "CATXYZTTT".